package com.fa4j.common.base.exception;

/**
 * 错误类型接口
 */
public interface ServerErrorType extends ErrorType {

    /**
     * 构建异常
     */
    default ServerException build(Object... args) {
        return build(null, null, args);
    }

    /**
     * 构建异常
     */
    default ServerException build(Throwable cause) {
        return build(null, cause);
    }

    /**
     * 构建异常
     */
    default ServerException build(String message, Throwable cause, Object... args) {
        return new ServerException(this, message, args, cause);
    }

}
